<template>
  <div :id = "id" :style = "{width,height}"></div>
</template>

<script>
import echarts from "echarts"
export default {
  props:['width' , 'height' , 'id' ],
  mounted(){
    const myChart1 = echarts.init(document.getElementById(this.id));
    // 绘制图表
    const option={
      xAxis: {
        type: 'category',
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            type: 'value'
        },
        tooltip: {},
        series: [{
            name:'访问量',
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line'
        }]
    }
    myChart1.setOption(option)
  }
}
</script>

<style>

</style>